<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>运单录入</title>
    <!-- 导入jquery核心类库 -->
    <script type="text/javascript" src="../../js/jquery-1.8.3.js"></script>
    <!-- 导入easyui类库 -->
    <link rel="stylesheet" type="text/css" href="../../js/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="../../js/easyui/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="../../js/easyui/ext/portal.css">
    <link rel="stylesheet" type="text/css" href="../../css/default.css">
    <link rel="stylesheet" type="text/css" href="../../css/bootstrap.min.css">
    <script type="text/javascript" src="../../js/easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../../js/easyui/ext/jquery.portal.js"></script>
    <script type="text/javascript" src="../../js/easyui/ext/jquery.cookie.js"></script>
    <script src="../../js/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $("body").css({
                visibility: "visible"
            });

            // 对save按钮条件 点击事件
            $('#save').click(function () {
                // 对form 进行校验
                if ($('#wayBillForm').form('validate')) {
                    $.post("../../wayBill_save.action", $("#wayBillForm").serialize(), function (data) {
                        if (data.success) {
                            $.messager.show({
                                title: '提示窗口',
                                msg: data.msg,
                                timeout: 5000,
                                showType: 'slide'
                            });
                            $("#wayBillForm").get(0).reset();
                            $("input[name='order.id']").val("");
                        } else {
                            $.messager.show({
                                title: '提示窗口',
                                msg: data.msg,
                                timeout: 5000,
                                showType: 'slide'
                            });
                        }
                    }, "json");
                } else {
                    $.messager.alert("警告", "输入有误", "warning");
                }
            });
            $("#orderNum").blur(function () {
                $.post("../../order_findByNum.action", {"orderNum": $(this).val()}, function (data) {
                    if (data.success) {
                        $("#wayBillForm").form('load', data.orderData);
                        $("#orderId").val(data.orderData.id);
                        $("#orderNum").val(data.orderData.orderNum);
                        $("#courierCompany").val(data.orderData.courier.company);
                        $("#courierName").val(data.orderData.courier.name);

                    } else {
                        $("#wayBillForm").get(0).reset();
                    }
                }, "json");
            });
            $("#wayBillNum").blur(function () {
                $.post("../../wayBill_findByNum.action", {"wayBillNum": $(this).val()}, function (data) {
                    if (data.success) {
                        $("#wayBillForm").form('load', data.wayBillData);
                    }
                }, "json");
            });
        });
    </script>
</head>

<body>
<div class="datagrid-toolbar">
    <a id="add" icon="icon-add" href="#" class="easyui-linkbutton" plain="true">新增</a>
    <a id="save" icon="icon-save" href="#" class="easyui-linkbutton" plain="true">保存</a>
    <a id="no" icon="icon-no" href="#" class="easyui-linkbutton" plain="true">取消</a>
</div>
<div style="width:95%;margin:10px auto">
    <form id="wayBillForm" action="../../wayBill_save.action" method="post">
        <div class="table-top">
            <table class="table-edit" width="95%">
                <tr class="title">
                    <td colspan="6">单号信息</td>
                </tr>
                <tr>
                    <td>订单号</td>
                    <td>
                        <input type="hidden" name="order.id" id="orderId"/>
                        <input id="orderNum" type="text" name="order.orderNum"/>
                    </td>
                    <td>运单号</td>
                    <td>
                        <input type="text" name="wayBillNum" required="true" class="easyui-validatebox"
                               id="wayBillNum"/>
                    </td>
                </tr>
                <tr>
                    <td>到达地</td>
                    <td><input type="text" name="arriveCity" required="true"/></td>
                    <td>产品时限</td>
                    <td>
                        <select class="easyui-combobox" name="sendProNum">
                            <option value="速运当日">速运当日</option>
                            <option value="速运次日">速运次日</option>
                            <option value="速运隔日">速运隔日</option>
                        </select>
                    </td>
                    <td>配载要求</td>
                    <td>
                        <select class="easyui-combobox" name="floadreqr">
                            <option value="无">无</option>
                            <option value="禁航空">禁航空</option>
                            <option value="禁铁路航空">禁铁路航空</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>受理单位</td>
                    <td><input type="text" id="courierCompany" name="order.courier.company" required="true"/></td>
                    <td>快递员</td>
                    <td><input type="text" id="courierName" name="order.courier.name" required="true"/></td>
                </tr>
            </table>
        </div>
        <div class="table-center" style="margin-top:15px">
            <div class="col-md-5">
                <table class="table-edit send" width="95%">
                    <tr class="title">
                        <td colspan="4">寄件人信息</td>
                    </tr>
                    <tr>
                        <td>寄件人</td>
                        <td><input type="text" name="sendName" required="true"/></td>
                        <td>地址</td>
                        <td><input type="text" name="sendAddress" required="true"/></td>
                    </tr>
                    <tr>
                        <td>公司</td>
                        <td><input type="text" name="sendCompany" required="true"/></td>
                        <td>电话</td>
                        <td><input type="text" name="sendMobile" required="true"/></td>
                    </tr>
                </table>

                <table class="table-edit receiver" width="95%">
                    <tr class="title">
                        <td colspan="4">收件人信息</td>
                    </tr>
                    <tr>
                        <td>收件人</td>
                        <td><input type="text" name="recName" required="true"/></td>
                        <td>地址</td>
                        <td><input type="text" name="recAddress" required="true"/></td>
                    </tr>
                    <tr>
                        <td>公司</td>
                        <td><input type="text" name="recCompany" required="true"/></td>
                        <td>电话</td>
                        <td><input type="text" name="recMobile" required="true"/></td>
                    </tr>
                </table>
                <table class="table-edit number" width="95%">
                    <tr class="title">
                        <td colspan="4">货物信息</td>
                    </tr>
                    <tr>
                        <td>原件数</td>
                        <td><input type="text" name="num" required="true"/></td>
                        <td>实际重量</td>
                        <td><input type="text" name="actlweit" required="true"/></td>
                    </tr>

                    <tr>
                        <td>货物</td>
                        <td><input type="text" name="goodsType" required="true"/></td>
                        <td>体积</td>
                        <td><input type="text" name="vol" required="true"/></td>
                    </tr>
                </table>
            </div>
            <div class="col-md-7">
                <table class="table-edit security" width="95%">
                    <tr class="title">
                        <td colspan="6">包装信息</td>
                    </tr>
                    <tr>
                        <td>保险类型</td>
                        <td>
                            <select class="easyui-combobox">
                                <option value="0">不保险</option>
                                <option value="1">委托投保</option>
                                <option value="2">自带投保</option>
                                <option value="3">保价</option>
                            </select>
                        </td>
                        <td>保险费</td>
                        <td><input type="text" name="secuityprice" required="true"/></td>
                        <td>声明价值</td>
                        <td><input type="text" name="value" required="true"/></td>
                    </tr>

                    <tr>
                        <td>原包装</td>
                        <td>
                            <select class="easyui-combobox">
                                <option value="0">木箱</option>
                                <option value="1">纸箱</option>
                                <option value="2">快递袋</option>
                                <option value="3">其他</option>
                            </select>
                        </td>
                        <td>实际包装</td>
                        <td>
                            <select class="easyui-combobox">
                                <option value="0">木箱</option>
                                <option value="1">纸箱</option>
                                <option value="2">快递袋</option>
                                <option value="3">其他</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>包装费</td>
                        <td><input type="text" name="packageprice" required="true"/></td>
                        <td>包装要求</td>
                        <td><input type="text" name="packageprice" required="true"/></td>
                    </tr>
                </table>

                <table class="table-edit max" width="95%">
                    <tr>
                        <td>实际件数</td>
                        <td><input type="text" name="realNum" required="true"/></td>
                        <td>计费重量</td>
                        <td><input type="text" name="priceWeight" required="true"/></td>
                    </tr>
                    <tr>
                        <td>预收费</td>
                        <td><input type="text" name="planprice" required="true"/></td>
                        <td>
                            <button class="btn btn-default">计算</button>
                        </td>
                    </tr>
                </table>

                <table class="table-edit money" width="95%">
                    <tr class="title">
                        <td colspan="6">计费信息</td>
                    </tr>
                    <tr>
                        <td>结算方式</td>
                        <td>
                            <select class="easyui-combobox">
                                <option value="0">现结</option>
                                <option value="1">代付</option>
                                <option value="2">网络</option>

                            </select>
                        </td>
                        <td>代收款</td>
                        <td><input type="text" name="priceWeight" required="true"/></td>
                        <td>到付款</td>
                        <td><input type="text" name="priceWeight" required="true"/></td>
                    </tr>

                </table>
                <table class="table-edit feedback" width="95%">
                    <tr class="title">
                        <td colspan="4">配送信息</td>
                    </tr>
                    <tr>
                        <td><input type="checkbox">反馈签收</td>
                        <td><input type="checkbox">节假日可收货</td>
                        <td>送达时限</td>
                        <td><input type="text" class="easyui-datebox" data-options="editable:false"/></td>
                    </tr>

                    <tr>
                        <td>处理方式</td>
                        <td>
                            <select class="easyui-combobox">
                                <option value="0">无</option>
                                <option value="1">不可开箱验货</option>
                                <option value="2">开开箱单不可开内包</option>
                                <option value="3">可开箱和内包</option>
                            </select>
                        </td>
                        <td>签单返回</td>
                        <td>
                            <select class="easyui-combobox">
                                <option value="0">箱单</option>
                                <option value="1">原单</option>
                                <option value="2">附原单</option>
                                <option value="3">网络派送单</option>
                            </select>
                        </td>
                    </tr>
                </table>
                <table class="table-edit tips" width="95%">
                    <tr>
                        <td>重要提示</td>
                        <td><textarea style="width:250px;height: 80px;"></textarea></td>
                    </tr>

                </table>
            </div>
        </div>
        <div class="clearfix"></div>
    </form>
</div>
</body>

</html>